<?php
/**
 * Created by PhpStorm.
 * User: linux
 * Date: 31/01/2018
 * Time: 4:32 PM
 */

namespace App\Advice;


use Go\Aop\Aspect;
use Go\Aop\Intercept\MethodInvocation;
use Go\Lang\Annotation\Before;

class OrderAspect implements Aspect
{


    /**
     * @param MethodInvocation $invocation
     * @Before("execution(public App\Example\Example4->testOrder(*))", order=1)
     */
    public function first(MethodInvocation $invocation)
    {
        echo 'I am running first' . PHP_EOL;
    }

    /**
     * @param MethodInvocation $invocation
     * @Before("execution(public App\Example\Example4->testOrder(*))", order=2)
     */
    public function second(MethodInvocation $invocation)
    {
        echo 'I am running second' . PHP_EOL;
    }
}